﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AssistCore
{
    public enum HotKeyTypes
    {
        SeriesKey = 100,
        ComboKey = 200
    }
    public enum KeyEventType
    {
        Delay = 0,
        KeyDown = 1,
        KeyUp = 2,
        LeftClick = 3,
        RightClick = 4,
        LeftDoubleClick = 5
    }
    public enum KeyModifiers        //组合键枚举
    {
        None = 0,
        Alt = 1,
        Control = 2,
        Shift = 4,
        Windows = 8
    }
    public enum MouseBtn           //鼠标按键枚举 
    {
        左下 = 1,
        左上 = 2,
        右下 = 4,
        右上 = 8
    }
    [Serializable]
    public class ComboKeyData
    {
        public ComboKeyData()
        {

        }
        public ComboKeyData(KeyEventType eventType, Keys keyCode, int delay = -1)
        {
            this.EventType = eventType;
            this.KeyCode = keyCode;
            this.Delay = delay;
        }
        public KeyEventType EventType { get; set; }
        public Keys KeyCode { get; set; }
        public int Delay { get; set; }

        public override string ToString()
        {
            switch (EventType)
            {
                case KeyEventType.Delay:
                    {
                        return string.Format("  ⊙延迟{0:N2}秒", new TimeSpan(0, 0, 0, 0, this.Delay).TotalSeconds);
                    }
                case KeyEventType.KeyDown:
                    {
                        return string.Format("↓按下{0}键", this.KeyCode.ToString());
                    }
                case KeyEventType.KeyUp:
                    {
                        return string.Format("↑松开{0}键", this.KeyCode.ToString());
                    }
                case KeyEventType.LeftClick:
                    {
                        return "单击左键";
                    }
                case KeyEventType.RightClick:
                    {
                        return "单击右键";
                    }
                case KeyEventType.LeftDoubleClick:
                    {
                        return "双击左键";
                    }
                default:
                    {
                        return base.ToString();
                    }
            }
        }
    }

}
